.family-card {
  padding: 16px;
}

.family-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  padding: 10px;
}

.members-1 {
  grid-template-columns: 1fr;
  margin: 0 auto;
}

.members-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 400px;
  margin: 0 auto;
}

.members-3,
.members-4,
.members-5,
.members-6 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 600px;
  margin: 0 auto;
}

.family-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  background: var(--color-card-bg-transparent) !important;
  transition: transform 0.2s;
  padding: 10px 0;
}
[data-theme="dark"] .family-person {
  background: rgba(60,60,60,0.3) !important;
}

/* 日间模式 */
:root {
  --color-mode: #f5f5f5;
}

/* 夜间模式 */
:root[data-theme="dark"] {
  --color-mode: #333;
}

.family-person:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.person-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.default-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgb(50,87,162);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
  border: 2px solid var(--color-background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-indicator.home {
  background-color: var(--color-success);
}

.status-indicator.away {
  background-color: var(--color-warning);
}

.person-name {
  font-weight: 500;
  color: var(--color-text-primary);
  text-align: center;
  margin: 0;
  font-size: 1em;
}

.person-status {
  font-size: 0.9em;
  color: var(--color-text-secondary);
  text-align: center;
}

@media (max-width: 768px) {
  .members-3,
  .members-4,
  .members-5,
  .members-6 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .family-members {
    grid-template-columns: repeat(2, 1fr);
    /* max-width: 200px; */
    margin: 0 auto;
  }
  
  .members-1 {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  
  .family-person {
    padding: 12px;
  }
}
